#pragma once
#include <string>

namespace util
{
	template<class T_>		T_ ABS(const T_& t1)
	{
		return t1 > 0 ?  t1 : -t1;
	}

	int CountDayNum(UINT start, UINT end);
	bool PriceEqual(double p1, double p2);
	
	std::wstring& TrimLeft(std::wstring &str);
	std::wstring& TrimRight(std::wstring &str);
	std::wstring& TrimBoth(std::wstring &str);

	bool IsShanghaiStock(const std::wstring &stkcode);
	bool IsShenzhenStock(const std::wstring &stkcode);
	std::wstring GetDbFileName(const std::wstring &stkcode);
	std::wstring GetTempFileName(const std::wstring &basename, const std::wstring &suffix);
	std::wstring GetModuleConfigFile();
	std::wstring GetModuleDir(bool bEndSlash = false);
}